BlueCielo Meridian Enterprise 2012 VBScript API Reference | BlueCielo ECM Solutions

You are here: Understanding the Meridian object model > About the Vault object > The Vault object methods > FindDocuments method

FindDocuments method

Searches for documents in the Main area of the current vault.

Syntax
FindDocuments([WildCard As String], [DocumentTypeNames As Variant],
[Criteria As Variant], OrSearch As Boolean) _
As IASDocuments
Parameters
Name Description

WildCard

Optional string that represents a file system wildcard pattern. If omitted, the scope of file names will include all documents (*.*).

DocumentTypeNames

Optional variant array of document type names to which to restrict the search result. If omitted, the scope of document types will include all document types.

Criteria

Optional variant array of property filter criteria.

OrSearch

Optional Boolean that if set to True specifies a Boolean OR search be performed. The default is False.

Return Value

Returns a collection of About the Document object objects matching the specified parameters.

Remarks

The Criteria parameter can be specified as a single criterion array or as an array of criterion arrays. Each criterion array contains a property name, operator, and an optional value similar to the Find command in PowerUser. For example, Custom.ProjectNr, equals, 2134, where equals is the operator.

The search operators that are supported are those in the IC_OPERATOR constants enumeration. The following table lists the supported operators and the abbreviations, symbols, and constants that may be used:

Search operator options
Operator Abbreviation Symbol

Constant

contains, in

C

*

IC_OP_CONTAINS

date equals    

IC_OP_DATE_EQUALS

date not equal    

IC_OP_DATE_NOT_EQUAL

doswildcard

   

IC_OP_DOSWILDCARD

empty

EM

()

IC_OP_EMPTY

equals, equal

E

EQ =

IC_OP_EQUALS

less

L

<

IC_OP_LESS

less equal

LE

<=

IC_OP_LESS_EQUAL

like

LI

%

IC_OP_LIKE

more

M

>

IC_OP_MORE

more equal

ME

>=

IC_OP_MORE_EQUAL

not contains

NC, NOT IN

 

IC_OP_NOT_CONTAINS

not empty

NEM

 

IC_OP_ NOT_EMPTY

not equal

NEQ, NE

<>

IC_OP_NOT_EQUAL

not like

NLI, NL

 

IC_OP_NOT_LIKE

not starts with

NSW

 

IC_OP_NOT_STARTWITH

starts with

SW

 

IC_OP_STARTWITH

Note    If you want to find a document with a specific ID, use the Vault.GetDocument method described in GetDocument method instead. Executing an expression such as Vault.FindDocuments.Document(ID) will cause the server to first create a collection of all documents in the vault and then search within that collection for the document with the specified ID. Such an operation can result in a large load on the server and take an excessive amount of time compared to using the Vault.GetDocument method.

Example

The following example demonstrates use of the FindDocuments method to display the results of a search executed with the specified parameters.

Sub SearchCount_Execute(Batch)
    Dim StrMask
    StrMask = "*1*.*"
    
    Dim MultipleDocTypes
    MultipleDocTypes = Array("My_Doc_Type", "Hybrid_Doc_Type")

    Dim MultipleCriteria
    MultipleCriteria = Array(_
        Array("Custom.CI",  IC_OP_MORE, 200),_
        Array("Custom.CI",  IC_OP_LESS, 300),_
        Array("Custom.CS",  IC_OP_CONTAINS, "o"),_
        Array("Custom.CStr",  IC_OP_CONTAINS, "iv"),_
        Array("LUL.lul",  IC_OP_EQUALS, "a-z"),_
        Array("AMVersionablePropertySet._VERSIONNUMBER",  IC_OP_LESS, 2),_
        Array("Custom.CDT",  IC_OP_LESS, (DateSerial(1983,07,12))),_
        Array("NewPS.CB",  IC_OP_EQUALS, False))
        
    Dim bool
    bool = True
    
    Dim Str
    Str = ""

    Dim Document
    
    For Each Document In Vault.FindDocuments(StrMask, MultipleDocTypes, _
        MultipleCriteria, bool)
        str = str &_                  
            " FileName - > " & Document.FileName & vbCrLf &_
            " Document.DocumentType.DisplayName - > " & _
                Document.DocumentType.DisplayName & vbCrLf &_
            " Custom.CI - > " & Document.CI & vbCrLf &_
            " Custom.CS - > " & Document.CS & vbCrLf &_
            " Custom.CStr - > " & Document.CStr & vbCrLf &_
            " Custom.CDT - > " & Document.CDT & vbCrLf &_
            " NewPS.CB - > " & Document.NewPS_CB & vbCrLf &_
            " NewPS.CM - > " & Document.NewPS_CM & vbCrLf &_
            " LUL.lul  - > " & Document.LUL_lul & vbCrLf &_
            " Revision - > " & Document.Revision & vbCrLf & vbCrLf
    Next

    WinMsgBox "Total number of documents found is " &_
        Vault.FindDocuments(StrMask, MultipleDocTypes, MultipleCriteria, bool).Count & _
            vbCrLf & vbCrLf & Str
End Sub

Note    The expression Vault.FindDocuments(<Criteria>).Count will return the number of documents that are found.

Note    The expression Vault.FindDocuments(<Criteria>).Properties will return 25 values for each document found without the property names, in random order.

Note    The expression Vault.FindDocuments(<Criteria>).Document(Document.ID).FileName will return the file name of a document if it matches the specified parameters.

Related concepts

Understanding the Meridian functions


Copyright © 2000-2012 BlueCielo ECM Solutions

www.bluecieloecm.com